﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 设计模式之禅.适配器模式
{
    /// <summary>
    /// 目标角色接口类
    /// </summary>
    public interface ITarget
    {
        string Say();
    }

    /// <summary>
    /// 源角色，被适配的类
    /// </summary>
    public abstract class SourceTarget
    {
        public string DoSomething()
        {
            return " SourceTarget ";
        }
    }

    /// <summary>
    /// 适配器类
    /// </summary>
    public class Adapter : SourceTarget, ITarget
    {
        public string Say()
        {
            return this.DoSomething();
        }
    }
}
